Views [dbo].[vSoaPendingARPaymentAdjustment]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Schema BoundYes
Created3:55:17 PM Thursday, February 23, 2012
Last Modified3:55:17 PM Thursday, February 23, 2012
Columns
Name
Cluster Key PK_vSoaPendingARPaymentAdjustment: INVOICE_REFERENCE_NUM\INVOICE_LINE_NUMINVOICE_REFERENCE_NUM
Cluster Key PK_vSoaPendingARPaymentAdjustment: INVOICE_REFERENCE_NUM\INVOICE_LINE_NUMINVOICE_LINE_NUM
Amount
Count
Indexes Indexes
NameColumnsUnique
Cluster Key PK_vSoaPendingARPaymentAdjustment: INVOICE_REFERENCE_NUM\INVOICE_LINE_NUMPK_vSoaPendingARPaymentAdjustmentINVOICE_REFERENCE_NUM, INVOICE_LINE_NUM
Yes
SQL Script

CREATE VIEW [dbo].[vSoaPendingARPaymentAdjustment] WITH SCHEMABINDING
AS
SELECT [INVOICE_REFERENCE_NUM],
       [INVOICE_LINE_NUM],
       SUM([INVOICE_CREDITS] - [INVOICE_CHARGES]) AS Amount,
       COUNT_BIG(*) [Count]
  FROM [dbo].Trans
  WHERE [POSTED] < 2 AND [TRANSACTION_TYPE] = 'AR' AND [JOURNAL_TYPE] = 'PAY' AND [INVOICE_REFERENCE_NUM] != 0
  GROUP BY [INVOICE_REFERENCE_NUM], [INVOICE_LINE_NUM]

GO
CREATE UNIQUE CLUSTERED INDEX [PK_vSoaPendingARPaymentAdjustment] ON [dbo].[vSoaPendingARPaymentAdjustment] ([INVOICE_REFERENCE_NUM], [INVOICE_LINE_NUM]) ON [PRIMARY]
GO
Uses
Used By